const _promise = require('./手写promise')

const res = new _promise((resolve, reject) => {
  console.log(111)
  setTimeout(() => {
    resolve('牛逼')
  }, 1000)
})

res.then(res => {
  console.log(res)
  return { a: 1, then: () => { console.log(123) } }
}).then((res) => {
  console.log(res)
})

const promise = new Promise(resolve => resolve(1))
const promise1 = new Promise((resolve, reject) => resolve(2))
const promise2 = new Promise(resolve => resolve(3))

res.all([promise, promise1, promise2]).then(o => console.log(o)).catch(e => console.log(e))
